<!--
 * @Author: raoyonggang 11886335+ryg321@user.noreply.gitee.com
 * @Date: 2023-11-08 09:51:45
 * @LastEditors: raoyonggang 11886335+ryg321@user.noreply.gitee.com
 * @LastEditTime: 2024-05-27 17:21:56
 * @FilePath: \my-electron\src\views\HomeView.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="home">
    <span class="home-title">江西菜东家信息技术有限公司触摸屏分拣系统</span>
    <div @click="closeWin" class="close-btn">
      <img src="../assets/close.png" alt="">
      <p>关闭</p>
    </div>
    <div class="home-box">
      <img class="home-box-img" src="../assets/company.png" alt="" />
      <el-input class="corporation-input" placeholder="请输入公司域名" v-model="corporationInfo" clearable> </el-input>
      <div class="btn" @click="save">保存设置</div>
      <verifyDialogVue v-if="dialogShow" @reset="verifyReset" @thinkAgain="closeVerify"></verifyDialogVue>
    </div>
  </div>
</template>

<script>
import verifyDialogVue from '@/components/verifyDialog.vue';
export default {
  name: "HomeView",
  data() {
    return {
      corporationInfo: localStorage.getItem('corporationInfo') || '',  //  公司信息
      dialogShow: false,
      isReset: localStorage.getItem('corporationInfo') ? true : false
    };
  },
  components: { verifyDialogVue },
  methods: {
    // 关闭
    closeWin () {
      window.close()
    },
    save () {
      if(!this.corporationInfo) return
      localStorage.setItem('corporationInfo', this.corporationInfo)
      this.$router.push({
        path: '/'
      })
    },
    reset () {
      this.dialogShow = true
    },
    //  重置
    verifyReset () {
      localStorage.setItem('corporationInfo', this.corporationInfo)
      this.closeVerify()
      this.$router.push({
        path: '/'
      })
    },
    //  关闭重置弹窗
    closeVerify () {
      this.dialogShow = false
    },
    //  返回
    backWin () {
      this.$router.push('/')
    }
  },
  mounted() {
  },
};
</script>
<style lang="scss" scoped>
.home {
  width: 100vw;
  height: 100vh;
  background-image: url("../assets/img-bg2.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.home-title {
  font-family: PingFang SC;
  font-weight: 800;
  font-size: 34px;
  color: #087e5c;
}
.home-box {
  width: 78.125%;
  height: 52.1%;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  border: 2px solid #ffffff;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

.home-box-img {
  width: 90px;
  height: 90px;
}

.corporation-input {
  margin-top: 15px;
  width: 40% !important;
  height: 60px !important;
  /deep/.el-input {
    height: 100% !important;
  }
  /deep/.el-input__inner {
    border-radius: 16px !important;
    height: 100% !important;
    line-height: 60px !important;
    font-size: 24px;
  }
  /deep/.el-input .el-input__inner::placeholder {
    font-weight: 400;
    line-height: 60px;
    text-align: center;
    color: #999999;
  }
}

.btn {
  width: 40%;
  height: 60px;
  line-height: 60px;
  text-align: center;
  background-color: #4fa388;
  border-radius: 16px;
  margin-top: 20px;
  font-family: PingFang SC;
  font-weight: 800;
  font-size: 24px;
  color: #ffffff;
  cursor: pointer;
  box-shadow: inset 0px 5px 5px -5px #fff, inset 0px -10px 10px -8px #111;
}

.close-btn {
  position: absolute;
  top: 30px;
  right: 30px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 122px;
  height: 58px;
  background-image: url("../assets/btnbg.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  p {
    font-size: 20px;
    font-family: PingFang SC, PingFang SC;
    color: #333333;
    margin: 0 0 0 5px;
  }
  img {
    width: 24px;
  }
}
.back-btn {
  position: absolute;
  top: 30px;
  left: 30px;
  cursor: pointer;
  color: #000;
  font-size: 20px;
}
</style>